package top.melody.ecommerce.platform.service.account.impl;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import top.melody.ecommerce.platform.EcommerceException;
import top.melody.ecommerce.platform.api.domain.account.AccountAddress;
import top.melody.ecommerce.platform.api.service.AccountAddressService;
import top.melody.ecommerce.platform.dal.account.AccountAddressMapper;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AccountAddressServiceImpl implements AccountAddressService {

    private static final Logger logger = LoggerFactory.getLogger(AccountAddressServiceImpl.class);
    @Resource
    private AccountAddressMapper accountAddressMapper;

    @Override
    public List<AccountAddress> findAccountAddressList(AccountAddress accountAddress) throws EcommerceException {

        try{
            List<AccountAddress> accountAddressList = accountAddressMapper.find(accountAddress);
            return accountAddressList;
        } catch (Exception e) {
            throw new EcommerceException("execute mapper query exception", e);
        }
    }
}
